﻿using Mes.Application.DTO.Inputs.MasterData;
using Mes.Application.DTO.Results.MasterData;
using Mes.Domain.BoundedContext;

namespace Mes.Application.Services.MasterData
{
    public interface IProductionUnitService
    {
        /// <summary>
        /// 新增生产单元
        /// </summary>
        /// <param name="productionUnitInput"></param>
        /// <returns></returns>
        Task AddProductionUnitAsync(ProductionUnitInput productionUnitInput);

        /// <summary>
        /// 修改生产单元
        /// </summary>
        /// <param name="productionUnitUpdateInput"></param>
        /// <returns></returns>
        Task UpdateProductionUnitAsync(ProductionUnitUpdateInput productionUnitUpdateInput);

        /// <summary>
        /// 删除生产单元
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task DeleteProductionUnitAsync(int[] ids);

        /// <summary>
        /// 根据主键编号查询生产单元
        /// </summary>
        /// <param name="id"></param>
        /// <returns>ProductionUnitResult</returns>
        Task<ProductionUnitResult> GetProductionUnitAsyncById(int id);

        /// <summary>
        /// 分页查询生产单元
        /// </summary>
        /// <param name="productionUnitPageInput"></param>
        /// <returns>PagedItemsData<ProductionUnitResult></returns>
        Task<PagedItemsData<ProductionUnitResult>> GetProductionUnitAsync(ProductionUnitPageInput productionUnitPageInput);

        /// <summary>
        /// 获取整棵树
        /// </summary>
        /// <returns>json树</returns>
        Task<string> GetProductionUnitTreeAsync();

        /// <summary>
        /// 获取所有孩子结点
        /// </summary>
        /// <param name="productionUnitChildsInput"></param>
        /// <returns>PagedItemsData<ProductionUnitResult></returns>
        Task<PagedItemsData<ProductionUnitResult>> GetProductionUnitChildsAsync(ProductionUnitChildsInput productionUnitChildsInput);
    }
}
